<?php



class GalleryHelper extends AppHelper {
	
	var $helpers = array('Html','Assets.Asset');
	
	var $columns = 4;
	var $title = "Gallery";
	var $galleryItems = array();
	var $options = array();
	var $imgOptions = array();
	var $galleryElement = 'gallery';
	var $showTitle = true;
	var $model  = null;
	
	
	function setColumns($columns)
	{
		$this->columns = $columns;
	}
	
	
	function setTitle($title)
	{
		$this->title = $title;
	}
	
	
	function setGalleryItems($galleryItems)
	{
		$this->galleryItems = $galleryItems;
	}
	
	
	function setImageOptions($options = array())
	{
		$this->imgOptions = $options;
	}
	
	function setOptions($options)
	{
		$this->options = $options;
	}
	
	function setGalleryElement($name)
	{
		$this->galleryElement = $name;
	}
	
	
	function output()
	{
		if(!$this->model)
			trigger_error("No model selected");
		$view = ClassRegistry::getObject('View');
		$output = $view->renderElement($this->galleryElement, array('columns'=>$this->columns, 'title'=>$this->title, 'galleryItems'=>$this->galleryItems, 'imgOptions'=>$this->imgOptions, 'showTitle'=>$this->showTitle,'options'=>$this->options,'model'=>$this->model));
		return $output;
	}
	
	
	function beforeRender()
	{
		$this->Html->css('/assets/css/gallery.css',false);
	}
	
	function setModel($model)
	{
		$this->model = $model;
	}
	
	
}
?>